/**
* @(#)ProcessPageStaticImpl.java 2009-12-23
*   
* Copyright  (c) 2009-2010 Wilmar IT Service,  Inc.   
* All  rights  reserved.   
* TODO
*/  

package com.wilmar.process.dao.impl;

import java.util.List;

import com.wilmar.process.dao.api.IProcessPageStaticDAO;
import com.wilmar.process.entity.ProcessPageStatic;
import com.wilmar.process.exception.ObjectNotFoundException;

/**
 * @author asus Email:zhoulibo_java@msn.cn
 * @version 1.0.0
 */
public class ProcessPageStaticDAOImpl extends BaseDAOImpl<ProcessPageStatic, Long> implements
		IProcessPageStaticDAO {

	/* 
	 * @see com.wilmar.process.dao.api.IProcessPageStaticDAO#getProcessPageStaticByHistoryTaskId(java.lang.String)
	 */
	public ProcessPageStatic getProcessPageStaticByHistoryTaskId(
			String historyTaskId) throws ObjectNotFoundException {
		
		ProcessPageStatic pageStatic = new ProcessPageStatic();
		pageStatic.setHistoryTaskId(historyTaskId);
		List<ProcessPageStatic> processPageStatics = this.getListByExample(pageStatic);
		if (processPageStatics.size()<1) {
			//throw new ObjectNotFoundException("processPageStatics not found exception!");
			// 暂时注释
			return null;
		} if(processPageStatics.size()>1){
			throw new ObjectNotFoundException("processPageStatics size must be 1!");
		} else {
			return processPageStatics.get(0);
		}
	}

}
